var express = require('express');
var router = express.Router();
var knex = require('../config/index')

router.get('/', function (req, res, next) {
    if(req.query.id != "" && req.query.id >= 0){
        knex('user').where('id',req.query.id).then(function(data) {
            console.log(data)
            res.render('admin/addUser', { title: '编辑用户', data: data});
        })
    }else{
        res.render('admin/addUser', { title: '添加新用户'});
    }
	
	
});

module.exports = router;
